Skip to content

Comments

Solidarity fund: Enable collection-only mode with pause/unpause#88

Merged
hudsonhrh merged 2 commits intohudsonhrh/event-ordering-fixfrom
hudsonhrh/solidarity-fund-analysis
Feb 9, 2026
Merged

Solidarity fund: Enable collection-only mode with pause/unpause#88
hudsonhrh merged 2 commits intohudsonhrh/event-ordering-fixfrom
hudsonhrh/solidarity-fund-analysis

Conversation

@hudsonhrh
Copy link
Member

Summary

Implement a pause/unpause mechanism for the solidarity fund distribution to allow fee collection without tier matching or grace period subsidies. When paused, organizations must self-fund 100% of transactions while 1% fees accumulate for future distribution.

This enables a phased rollout: launch with fee collection, monitor fund health, then enable distribution when ready.

Changes

  • Add distributionPaused flag to SolidarityFund struct (defaults to true on init)
  • Implement pauseSolidarityDistribution() / unpauseSolidarityDistribution() (PoaManager only)
  • Update payment logic to pay 100% from deposits when paused, still collect 1% fee
  • Block solidarity access checks entirely when paused
  • Block POA onboarding when paused (it draws from solidarity)
  • Fix getOrgGraceStatus() to return accurate data (solidarityLimit=0) when paused
  • Add idempotency guards: pause/unpause only emit events if state changes

Test Coverage

  • 16 new tests: initialization state, access control, state transitions, idempotency, view function behavior
  • All 643 tests passing

🤖 Generated with Claude Code

Enable fee collection without distribution: PaymasterHub now supports pausing solidarity fund distribution to allow fee accumulation before enabling the tier matching and grace period systems. When paused, organizations must fund 100% of transactions from their own deposits while 1% fees still accumulate in the solidarity fund.

Key changes:
- Add distributionPaused boolean flag to SolidarityFund struct
- Implement pauseSolidarityDistribution() and unpauseSolidarityDistribution() (PoaManager only)
- Update _checkSolidarityAccess, _updateOrgFinancials, and _checkOrgBalance to respect paused state
- Block POA onboarding when distribution is paused
- Fix getOrgGraceStatus to return accurate values (solidarity=0) when paused
- Add idempotency guards to pause/unpause functions (no-op when already in that state)

Tests:
- 16 new tests covering initialization, access control, state transitions, idempotency, and view function behavior when paused
- All 643 existing tests passing

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@hudsonhrh hudsonhrh changed the base branch from main to hudsonhrh/event-ordering-fix February 9, 2026 18:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hudsonhrh hudsonhrh merged commit f86fe27 into hudsonhrh/event-ordering-fix Feb 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant